home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 7 / Amiga Format AFCD07 (Dec 1996, Issue 91).iso / serious / shareware / programming / emacs-complete / fsf / emacs / lisp / tcl-mode.el < prev    next >
Lisp/Scheme  |  1994-09-01  |  18KB  |  630 lines

  1. ;; tcl-mode.el - A major-mode for editing tcl/tk scripts
  2. ;;
  3. ;; Author: Gregor Schmid <schmid@fb3-s7.math.tu-berlin.de>
  4. ;; Keywords: languages, processes, tools
  5. ;;
  6. ;; Copyright (C) 1993, 1994 Free Software Foundation, Inc.
  7. ;; Version 1.1
  8.  
  9. ;; This file is part of GNU Emacs.
  10.  
  11. ;; GNU Emacs is free software; you can redistribute it and/or modify
  12. ;; it under the terms of the GNU General Public License as published by
  13. ;; the Free Software Foundation; either version 2, or (at your option)
  14. ;; any later version.
  15.  
  16. ;; GNU Emacs is distributed in the hope that it will be useful,
  17. ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
  18. ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  19. ;; GNU General Public License for more details.
  20.  
  21. ;; You should have received a copy of the GNU General Public License
  22. ;; along with GNU Emacs; see the file COPYING.  If not, write to
  23. ;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
  24.  
  25. ;; Please send bug-reports, suggestions etc. to
  26. ;;
  27. ;;         schmid@fb3-s7.math.tu-berlin.de
  28. ;;
  29.  
  30. ;; This file was written with emacs using Jamie Lokier's folding mode
  31. ;; That's what the funny ;;{{{ marks are there for
  32.  
  33. ;;{{{ Usage
  34.  
  35. ;;; Commentary:
  36.  
  37. ;; Tcl-mode supports c-mode style formatting and sending of
  38. ;; lines/regions/files to a tcl interpreter. An interpreter (see
  39. ;; variable `tcl-default-application') will be started if you try to
  40. ;; send some code and none is running. You can use the process-buffer
  41. ;; (named after the application you chose) as if it were an
  42. ;; interactive shell. See the documentation for `comint.el' for
  43. ;; details.
  44.  
  45. ;; Another version of this package which has support for other Emacs
  46. ;; versions is in the LCD archive.
  47.  
  48. ;;}}}
  49. ;;{{{ Key-bindings
  50.  
  51. ;; To see all the keybindings for folding mode, look at `tcl-setup-keymap'
  52. ;; or start `tcl-mode' and type `\C-h m'.
  53. ;; The keybindings may seem strange, since I prefer to use them with
  54. ;; tcl-prefix-key set to nil, but since those keybindings are already used
  55. ;; the default for `tcl-prefix-key' is `\C-c', which is the conventional
  56. ;; prefix for major-mode commands.
  57.  
  58. ;; You can customise the keybindings either by setting `tcl-prefix-key'
  59. ;; or by putting the following in your .emacs
  60. ;;     (setq tcl-mode-map (make-sparse-keymap))
  61. ;; and
  62. ;;     (define-key tcl-mode-map <your-key> <function>)
  63. ;; for all the functions you need.
  64.  
  65. ;;}}}
  66. ;;{{{ Variables
  67.  
  68. ;; You may want to customize the following variables:
  69. ;;     tcl-indent-level
  70. ;;     tcl-always-show
  71. ;;    tcl-mode-map
  72. ;;    tcl-prefix-key
  73. ;;    tcl-mode-hook
  74. ;;     tcl-default-application
  75. ;;     tcl-default-command-switches
  76.  
  77. ;;}}}
  78.  
  79. ;;; Code:
  80.  
  81. ;; We need that !
  82. (require 'comint)
  83.  
  84. ;;{{{ variables
  85.  
  86. (defvar tcl-default-application "wish"
  87.   "Default tcl/tk application to run in tcl subprocess.")
  88.  
  89. (defvar tcl-default-command-switches nil
  90.   "Command switches for `tcl-default-application'.
  91. Should be a list of strings.")
  92.  
  93. (defvar tcl-process nil
  94.   "The active tcl subprocess corresponding to current buffer.")
  95.  
  96. (defvar tcl-process-buffer nil
  97.   "Buffer used for communication with tcl subprocess for current buffer.")
  98.  
  99. (defvar tcl-always-show t
  100.   "*Non-nil means display tcl-process-buffer after sending a command.")
  101.  
  102. (defvar tcl-mode-map nil
  103.   "Keymap used with tcl mode.")
  104.  
  105. (defvar tcl-prefix-key "\C-c"
  106.   "Prefix for all tcl-mode commands.")
  107.  
  108. (defvar tcl-mode-hook nil
  109.   "Hooks called when tcl mode fires up.")
  110.  
  111. (defvar tcl-region-start (make-marker)
  112.   "Start of special region for tcl communication.")
  113.  
  114. (defvar tcl-region-end (make-marker)
  115.   "End of special region for tcl communication.")
  116.  
  117. (defvar tcl-indent-level 4
  118.   "Amount by which tcl subexpressions are indented.")
  119.  
  120. (defvar tcl-default-eval "eval"
  121.   "Default command used when sending regions.")
  122.  
  123. (defvar tcl-mode-menu (make-sparse-keymap "Tcl-Mode")
  124.   "Keymap for tcl-mode's menu.")
  125.  
  126. ;;}}}
  127. ;;{{{ tcl-mode
  128.  
  129. ;;;###autoload
  130. (defun tcl-mode ()
  131.   "Major mode for editing tcl scripts.
  132. The following keys are bound:
  133. \\{tcl-mode-map}
  134. "
  135.   (interactive)
  136.   (let ((switches nil)
  137.     s)
  138.     (kill-all-local-variables)
  139.     (setq major-mode 'tcl-mode)
  140.     (setq mode-name "TCL")
  141.     (set (make-local-variable 'tcl-process) nil)
  142.     (set (make-local-variable 'tcl-process-buffer) nil)
  143.     (make-local-variable 'tcl-default-command-switches)
  144.     (set (make-local-variable 'indent-line-function) 'tcl-indent-line)
  145.     (set (make-local-variable 'comment-start) "#")
  146.     (set (make-local-variable 'comment-start-skip) "\\(\\(^\\|;\\)[ \t]*\\)#")
  147.     (make-local-variable 'tcl-default-eval)
  148.     (or tcl-mode-map
  149.     (tcl-setup-keymap))
  150.     (use-local-map tcl-mode-map)
  151.     (set-syntax-table (copy-syntax-table))
  152.     (modify-syntax-entry ?# "<")
  153.     (modify-syntax-entry ?\n ">")
  154.     ;; look for a #!.../wish -f line at bob
  155.     (save-excursion
  156.       (goto-char (point-min))
  157.       (if (looking-at "#![ \t]*\\([^ \t]*\\)[ \t]\\(.*[ \t]\\)-f")
  158.       (progn
  159.         (set (make-local-variable 'tcl-default-application)
  160.          (buffer-substring (match-beginning 1)
  161.                    (match-end 1)))
  162.         (if (match-beginning 2)
  163.         (progn
  164.           (goto-char (match-beginning 2))
  165.           (set (make-local-variable 'tcl-default-command-switches) nil)
  166.           (while (< (point) (match-end 2))
  167.             (setq s (read (current-buffer)))
  168.             (if (<= (point) (match-end 2))
  169.             (setq tcl-default-command-switches
  170.                   (append tcl-default-command-switches
  171.                       (list (prin1-to-string s)))))))))
  172.     ;; if this fails, look for the #!/bin/csh ... exec hack
  173.     (while (eq (following-char) ?#)
  174.       (forward-line 1))
  175.     (or (bobp)
  176.         (forward-char -1))
  177.     (if (eq (preceding-char) ?\\)
  178.         (progn
  179.           (forward-char 1)
  180.           (if (looking-at "exec[ \t]+\\([^ \t]*\\)[ \t]\\(.*[ \t]\\)*-f")
  181.           (progn
  182.             (set (make-local-variable 'tcl-default-application)
  183.              (buffer-substring (match-beginning 1)
  184.                        (match-end 1)))
  185.             (if (match-beginning 2)
  186.             (progn
  187.               (goto-char (match-beginning 2))
  188.               (set (make-local-variable
  189.                 'tcl-default-command-switches)
  190.                    nil)
  191.               (while (< (point) (match-end 2))
  192.                 (setq s (read (current-buffer)))
  193.                 (if (<= (point) (match-end 2))
  194.                 (setq tcl-default-command-switches
  195.                       (append tcl-default-command-switches
  196.                           (list (prin1-to-string s)))))))))
  197.         )))))
  198.     (run-hooks 'tcl-mode-hook)))
  199.  
  200. ;;}}}
  201. ;;{{{ tcl-setup-keymap
  202.  
  203. (defun tcl-setup-keymap ()
  204.   "Set up keymap for tcl mode.
  205. If the variable `tcl-prefix-key' is nil, the bindings go directly
  206. to `tcl-mode-map', otherwise they are prefixed with `tcl-prefix-key'."
  207.   (setq tcl-mode-map (make-sparse-keymap))
  208.   (define-key tcl-mode-map [menu-bar tcl-mode]
  209.     (cons "Tcl-Mode" tcl-mode-menu))
  210.   (let ((map (if tcl-prefix-key
  211.          (make-sparse-keymap)
  212.            tcl-mode-map)))
  213.   ;; indentation
  214.   (define-key tcl-mode-map [?}] 'tcl-electric-brace)
  215.   ;; communication
  216.   (define-key map "\M-e" 'tcl-send-current-line)
  217.   (define-key map "\M-r" 'tcl-send-region)
  218.   (define-key map "\M-w" 'tcl-send-proc)
  219.   (define-key map "\M-a" 'tcl-send-buffer)
  220.   (define-key map "\M-q" 'tcl-kill-process)
  221.   (define-key map "\M-u" 'tcl-restart-with-whole-file)
  222.   (define-key map "\M-s" 'tcl-show-process-buffer)
  223.   (define-key map "\M-h" 'tcl-hide-process-buffer)
  224.   (define-key map "\M-i" 'tcl-get-error-info)
  225.   (define-key map "\M-[" 'tcl-beginning-of-proc)
  226.   (define-key map "\M-]" 'tcl-end-of-proc)
  227.   (define-key map "\C-\M-s" 'tcl-set-tcl-region-start)
  228.   (define-key map "\C-\M-e" 'tcl-set-tcl-region-end)
  229.   (define-key map "\C-\M-r" 'tcl-send-tcl-region)
  230.   (if tcl-prefix-key
  231.       (define-key tcl-mode-map tcl-prefix-key map))
  232.   ))
  233.  
  234. ;;}}}
  235. ;;{{{ indentation
  236.  
  237. ;;{{{ tcl-indent-line
  238.  
  239. (defun tcl-indent-line ()
  240.   "Indent current line as tcl code.
  241. Return the amount the indentation changed by."
  242.   (let ((indent (tcl-calculate-indentation nil))
  243.     beg shift-amt
  244.     (case-fold-search nil)
  245.     (pos (- (point-max) (point))))
  246.     (beginning-of-line)
  247.     (setq beg (point))
  248.     (skip-chars-forward " \t")
  249.     (save-excursion
  250.       (while (eq (following-char) ?})
  251.     (setq indent (max (- indent tcl-indent-level) 0))
  252.     (forward-char 1)
  253.     (if (looking-at "\\([ \t]*\\)}")
  254.         (progn
  255.           (delete-region (match-beginning 1) (match-end 1))
  256.           (insert-char ?  (1- tcl-indent-level))))))
  257.     (setq shift-amt (- indent (current-column)))
  258.     (if (zerop shift-amt)
  259.     (if (> (- (point-max) pos) (point))
  260.         (goto-char (- (point-max) pos)))
  261.       (delete-region beg (point))
  262.       (indent-to indent)
  263.       ;; If initial point was within line's indentation,
  264.       ;; position after the indentation.  Else stay at same point in text.
  265.       (if (> (- (point-max) pos) (point))
  266.       (goto-char (- (point-max) pos))))
  267.     shift-amt))
  268.  
  269. ;;}}}
  270. ;;{{{ tcl-calculate-indentation
  271.  
  272. (defun tcl-calculate-indentation (&optional parse-start)
  273.   "Return appropriate indentation for current line as tcl code.
  274. In usual case returns an integer: the column to indent to."
  275.   (let ((pos (point)))
  276.     (save-excursion
  277.       (if parse-start
  278.       (setq pos (goto-char parse-start)))
  279.       (beginning-of-line)
  280.       (if (bobp)
  281.       (current-indentation)
  282.     (forward-char -1)
  283.     (if (eq (preceding-char) ?\\)
  284.         (+ (current-indentation)
  285.            (progn
  286.          (beginning-of-line)
  287.          (if (bobp)
  288.              (* 2 tcl-indent-level)
  289.            (forward-char -1)
  290.            (if (not (eq (preceding-char) ?\\))
  291.                (* 2 tcl-indent-level)
  292.              0))))
  293.       (forward-char 1)
  294.       (if (re-search-backward
  295.            "\\(^[^ \t\n\r]\\)\\|\\({\\s *\n\\)\\|\\(}\\s *\n\\)"
  296.            nil  t)
  297.           (+ (- (current-indentation)
  298.             (if (save-excursion
  299.               (beginning-of-line)
  300.               (and (not (bobp))
  301.                    (progn
  302.                  (forward-char -1)
  303.                  (eq (preceding-char) ?\\))))
  304.             (* 2 tcl-indent-level)
  305.               0))
  306.          (if (eq (following-char) ?{)
  307.              tcl-indent-level
  308.            0))
  309.         (goto-char pos)
  310.         (beginning-of-line)
  311.         (forward-line -1)
  312.         (current-indentation)))))))
  313.  
  314. ;;}}}
  315. ;;{{{ tcl-electric-brace
  316.  
  317. (defun tcl-electric-brace (arg)
  318.   "Insert `}' and indent line for tcl."
  319.   (interactive "P")
  320.   (insert-char ?} (prefix-numeric-value arg))
  321.   (tcl-indent-line)
  322.   (blink-matching-open))
  323.  
  324. ;;}}}
  325.  
  326. ;;}}}
  327. ;;{{{ searching
  328.  
  329. ;;{{{ tcl-beginning-of-proc
  330.  
  331. (defun tcl-beginning-of-proc (&optional arg)
  332.   "Move backward to the beginning of a tcl proc (or similar).
  333. With argument, do it that many times.  Negative arg -N
  334. means move forward to Nth following beginning of proc.
  335. Returns t unless search stops due to beginning or end of buffer."
  336.   (interactive "P")
  337.   (or arg
  338.       (setq arg 1))
  339.   (let ((found nil)
  340.     (ret t))
  341.     (if (and (< arg 0)
  342.          (looking-at "^[^ \t\n#][^\n]*{[ \t]*$"))
  343.     (forward-char 1))
  344.     (while (< arg 0)
  345.       (if (re-search-forward "^[^ \t\n#][^\n]*{[ \t]*$" nil t)
  346.       (setq arg (1+ arg)
  347.         found t)
  348.     (setq ret nil
  349.           arg 0)))
  350.     (if found
  351.     (beginning-of-line))
  352.     (while (> arg 0)
  353.       (if (re-search-backward "^[^ \t\n#][^\n]*{[ \t]*$" nil t)
  354.       (setq arg (1- arg))
  355.     (setq ret nil
  356.           arg 0)))
  357.     ret))
  358.  
  359. ;;}}}
  360. ;;{{{ tcl-end-of-proc
  361.  
  362. (defun tcl-end-of-proc (&optional arg)
  363.   "Move forward to next end of tcl proc (or similar).
  364. With argument, do it that many times.  Negative argument -N means move
  365. back to Nth preceding end of proc.
  366.  
  367. This function just searches for a `}' at the beginning of a line."
  368.   (interactive "P")
  369.   (or arg
  370.       (setq arg 1))
  371.   (let ((found nil)
  372.     (ret t))
  373.     (if (and (< arg 0)
  374.          (not (bolp))
  375.          (save-excursion
  376.            (beginning-of-line)
  377.            (eq (following-char) ?})))
  378.     (forward-char -1))
  379.     (while (> arg 0)
  380.       (if (re-search-forward "^}" nil t)
  381.       (setq arg (1- arg)
  382.         found t)
  383.     (setq ret nil
  384.           arg 0)))
  385.     (while (< arg 0)
  386.       (if (re-search-backward "^}" nil t)
  387.       (setq arg (1+ arg)
  388.         found t)
  389.     (setq ret nil
  390.           arg 0)))
  391.     (if found
  392.     (end-of-line))
  393.     ret))
  394.  
  395. ;;}}}
  396.  
  397. ;;}}}
  398. ;;{{{ communication with a inferior process via comint
  399.  
  400. ;;{{{ tcl-start-process
  401.  
  402. (defun tcl-start-process (name program &optional startfile &rest switches)
  403.   "Start a tcl process named NAME, running PROGRAM."
  404.   (or switches
  405.       (setq switches tcl-default-command-switches))
  406.   (setq tcl-process-buffer (apply 'make-comint name program startfile switches))
  407.   (setq tcl-process (get-buffer-process tcl-process-buffer))
  408.   (save-excursion
  409.     (set-buffer tcl-process-buffer)
  410.     (setq comint-prompt-regexp "^[^% ]*%\\( %\\)* *"))
  411.   )
  412.  
  413. ;;}}}
  414. ;;{{{ tcl-kill-process
  415.  
  416. (defun tcl-kill-process ()
  417.   "Kill tcl subprocess and its buffer."
  418.   (interactive)
  419.   (if tcl-process-buffer
  420.       (kill-buffer tcl-process-buffer)))
  421.  
  422. ;;}}}
  423. ;;{{{ tcl-set-tcl-region-start
  424.  
  425. (defun tcl-set-tcl-region-start (&optional arg)
  426.   "Set start of region for use with `tcl-send-tcl-region'."
  427.   (interactive)
  428.   (set-marker tcl-region-start (or arg (point))))
  429.  
  430. ;;}}}
  431. ;;{{{ tcl-set-tcl-region-end
  432.  
  433. (defun tcl-set-tcl-region-end (&optional arg)
  434.   "Set end of region for use with `tcl-send-tcl-region'."
  435.   (interactive)
  436.   (set-marker tcl-region-end (or arg (point))))
  437.  
  438. ;;}}}
  439. ;;{{{ send line/region/buffer to tcl-process
  440.  
  441. ;;{{{ tcl-send-current-line
  442.  
  443. (defun tcl-send-current-line ()
  444.   "Send current line to tcl subprocess, found in `tcl-process'.
  445. If `tcl-process' is nil or dead, start a new process first."
  446.   (interactive)
  447.   (let ((start (save-excursion (beginning-of-line) (point)))
  448.     (end (save-excursion (end-of-line) (point))))
  449.     (or (and tcl-process
  450.          (eq (process-status tcl-process) 'run))
  451.     (tcl-start-process tcl-default-application tcl-default-application))
  452.     (comint-simple-send tcl-process (buffer-substring start end))
  453.     (forward-line 1)
  454.     (if tcl-always-show
  455.     (display-buffer tcl-process-buffer))))
  456.  
  457. ;;}}}
  458. ;;{{{ tcl-send-region
  459.  
  460. (defun tcl-send-region (start end)
  461.   "Send region to tcl subprocess, wrapped in `eval { ... }'."
  462.   (interactive "r")
  463.   (or (and tcl-process
  464.        (comint-check-proc tcl-process-buffer))
  465.       (tcl-start-process tcl-default-application tcl-default-application))
  466.   (comint-simple-send tcl-process
  467.               (concat tcl-default-eval
  468.                   " {\n"(buffer-substring start end) "\n}"))
  469.   (if tcl-always-show
  470.       (display-buffer tcl-process-buffer)))
  471.  
  472. ;;}}}
  473. ;;{{{ tcl-send-tcl-region
  474.  
  475. (defun tcl-send-tcl-region ()
  476.   "Send preset tcl region to tcl subprocess, wrapped in `eval { ... }'."
  477.   (interactive)
  478.   (or (and tcl-region-start tcl-region-end)
  479.       (error "tcl-region not set"))
  480.   (or (and tcl-process
  481.        (comint-check-proc tcl-process-buffer))
  482.       (tcl-start-process tcl-default-application tcl-default-application))
  483.   (comint-simple-send tcl-process
  484.               (concat tcl-default-eval
  485.                   " {\n"
  486.                   (buffer-substring tcl-region-start tcl-region-end)
  487.                   "\n}"))
  488.   (if tcl-always-show
  489.       (display-buffer tcl-process-buffer)))
  490.  
  491. ;;}}}
  492. ;;{{{ tcl-send-proc
  493.  
  494. (defun tcl-send-proc ()
  495.   "Send proc around point to tcl subprocess, wrapped in `eval { ... }'."
  496.   (interactive)
  497.   (let (beg end)
  498.     (save-excursion
  499.       (tcl-beginning-of-proc)
  500.       (setq beg (point))
  501.       (tcl-end-of-proc)
  502.       (setq end (point)))
  503.     (or (and tcl-process
  504.          (comint-check-proc tcl-process-buffer))
  505.     (tcl-start-process tcl-default-application tcl-default-application))
  506.     (comint-simple-send tcl-process
  507.             (concat tcl-default-eval
  508.                 " {\n"
  509.                 (buffer-substring beg end)
  510.                 "\n}"))
  511.     (if tcl-always-show
  512.     (display-buffer tcl-process-buffer))))
  513.  
  514. ;;}}}
  515. ;;{{{ tcl-send-buffer
  516.  
  517. (defun tcl-send-buffer ()
  518.   "Send whole buffer to tcl subprocess, wrapped in `eval { ... }'."
  519.   (interactive)
  520.   (or (and tcl-process
  521.        (comint-check-proc tcl-process-buffer))
  522.       (tcl-start-process tcl-default-application tcl-default-application))
  523.   (if (buffer-modified-p)
  524.       (comint-simple-send tcl-process
  525.               (concat
  526.                tcl-default-eval
  527.                " {\n"
  528.                (buffer-substring (point-min) (point-max))
  529.                "\n}"))
  530.     (comint-simple-send tcl-process
  531.             (concat "source "
  532.                 (buffer-file-name)
  533.                 "\n")))
  534.   (if tcl-always-show
  535.       (display-buffer tcl-process-buffer)))
  536.  
  537. ;;}}}
  538.  
  539. ;;}}}
  540. ;;{{{ tcl-get-error-info
  541.  
  542. (defun tcl-get-error-info ()
  543.   "Send string `set errorInfo' to tcl subprocess and display the tcl buffer."
  544.   (interactive)
  545.   (or (and tcl-process
  546.        (comint-check-proc tcl-process-buffer))
  547.       (tcl-start-process tcl-default-application tcl-default-application))
  548.   (comint-simple-send tcl-process "set errorInfo\n")
  549.   (display-buffer tcl-process-buffer))
  550.  
  551. ;;}}}
  552. ;;{{{ tcl-restart-with-whole-file
  553.  
  554. (defun tcl-restart-with-whole-file ()
  555.   "Restart tcl subprocess and send whole file as input."
  556.   (interactive)
  557.   (tcl-kill-process)
  558.   (tcl-start-process tcl-default-application tcl-default-application)
  559.   (tcl-send-buffer))
  560.   
  561. ;;}}}  
  562. ;;{{{ tcl-show-process-buffer
  563.  
  564. (defun tcl-show-process-buffer ()
  565.   "Make sure `tcl-process-buffer' is being displayed."
  566.   (interactive)
  567.   (display-buffer tcl-process-buffer))
  568.  
  569. ;;}}}
  570. ;;{{{ tcl-hide-process-buffer
  571.  
  572. (defun tcl-hide-process-buffer ()
  573.   "Delete all windows that display `tcl-process-buffer'."
  574.   (interactive)
  575.   (delete-windows-on tcl-process-buffer))
  576.  
  577. ;;}}}
  578.  
  579. ;;}}}
  580.  
  581. ;;{{{ menu bar
  582.  
  583. (define-key tcl-mode-menu [restart-with-whole-file]
  584.   '("Restart With Whole File" .  tcl-restart-with-whole-file))
  585. (define-key tcl-mode-menu [kill-process]
  586.   '("Kill Process" . tcl-kill-process))
  587.  
  588. (define-key tcl-mode-menu [hide-process-buffer]
  589.   '("Hide Process Buffer" . tcl-hide-process-buffer))
  590. (define-key tcl-mode-menu [get-error-info]
  591.   '("Get Error Info" . tcl-get-error-info))
  592. (define-key tcl-mode-menu [show-process-buffer]
  593.   '("Show Process Buffer" . tcl-show-process-buffer))
  594.  
  595. (define-key tcl-mode-menu [end-of-proc]
  596.   '("End Of Proc" . tcl-end-of-proc))
  597. (define-key tcl-mode-menu [beginning-of-proc]
  598.   '("Beginning Of Proc" . tcl-beginning-of-proc))
  599.  
  600. (define-key tcl-mode-menu [send-tcl-region]
  601.   '("Send Tcl-Region" . tcl-send-tcl-region))
  602. (define-key tcl-mode-menu [set-tcl-regio-end]
  603.   '("Set Tcl-Region End" . tcl-set-tcl-region-end))
  604. (define-key tcl-mode-menu [set-tcl-region-start]
  605.   '("Set Tcl-Region Start" . tcl-set-tcl-region-start))
  606.  
  607. (define-key tcl-mode-menu [send-current-line]
  608.   '("Send Current Line" . tcl-send-current-line))
  609. (define-key tcl-mode-menu [send-region]
  610.   '("Send Region" . tcl-send-region))
  611. (define-key tcl-mode-menu [send-proc]
  612.   '("Send Proc" . tcl-send-proc))
  613. (define-key tcl-mode-menu [send-buffer]
  614.   '("Send Buffer" . tcl-send-buffer))
  615.  
  616. ;;}}}
  617.  
  618. ;;{{{ Emacs local variables
  619.  
  620.  
  621. (provide 'tcl-mode)
  622.  
  623. ;; Local Variables:
  624. ;; folded-file: t
  625. ;; End:
  626.  
  627. ;;}}}
  628.  
  629. ;;; tcl-mode.el ends here
  630.